#pragma once

#include <vector>
#include <iostream>
#include <fstream>
#include <sstream>
#include <algorithm>
#include <iterator>

using namespace std;

class HMM_State
{
public:
	HMM_State();
	//HMM_State(double* mean, double* var, double gconst);

	~HMM_State();

	void SetMean(vector<double> mean);
	void SetVariance(vector<double> variance);
	void SetGConst(double gconst);
	double GetObservationLikelihoodLog(vector<double> mfcc);


	bool CheckGConst();

	friend istream& operator >>(istream &is,HMM_State &obj);

private:
	vector<double> _mean;
	vector<double> _variance;
	double _gconst;


};

class HMM
{
public:
	HMM();
	HMM(std::string label);
	HMM(std::string label, int numstates, vector<vector<double>> transp, std::vector<HMM_State*> states);
	~HMM(void);

	void AddState(HMM_State* s);
	void AddHMMSerial(HMM* hmm);
	void SetTransitionProbabilities(vector<vector<double>> p);
	vector<vector<double>> GetTransitionProbabilities() {return _transp; }
	unsigned int GetNumState() { 
		// return _numstates;
		return _transp.size();
	}
	std::vector<HMM_State*> GetStates() { return _states; }

	string GetLabel() { return _label; }

	friend istream& operator >>(istream &is,HMM &obj);

private:
	int _numstates;
	vector<vector<double>> _transp;
	std::vector<HMM_State*> _states;
	std::string _label;
};

